<template>
    <div class='flex'>
        <div><input type="checkbox" v-model="clicked.res"></div>
        <div>{{dname}}</div>
        <div>{{price}}&nbsp;元</div>
        <div><input type="button" value="+" @click="addFn(id)">&nbsp;&nbsp;{{numbers}}&nbsp;&nbsp;<input type="button" value="-" @click="redFn(id)"></div>
        <div>{{price*numbers}}&nbsp;元</div>
        <div><input type="button" value="DEL" @click="delFn(id)"></div>
    </div>
</template>

<script>
export default {
    props:['id','dname','price','clicked','numbers','setclick'],
    // 删除商品
    methods: {
        delFn(id){
            this.$emit('delChild', id)
        },
        addFn(id){
            this.$emit('addPrice', id)
        },
        redFn(id){
            this.$emit('redPrice',id)
        }
    },
    computed:{
        // locClicked(val){
        //     console.log(val);
        //     return this.setclick
        // }
    },
    watch:{
        // locClicked(){
        //     this.$emit('locCleck', this.locClicked, this.id)
        // }
    }
}
</script>

<style>

</style>